package info.openlvb.openface.server;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

public class FileProperties {

	static Properties prop;
	private static FileProperties instance = null;
	
	
	public FileProperties(){
		FileInputStream in;
		prop = new Properties();
		try {
			in = new FileInputStream("ldap.properties");
			prop.load(in);
			in.close();
		} catch (FileNotFoundException e) {
			System.out.println("fichier pas trouvé");
			e.printStackTrace();
		} catch (IOException io) {
			io.printStackTrace();
		}
		
	}
	public final static FileProperties getInstance(){
		if(instance==null){
			instance = new FileProperties(); 
			return instance;
		}else{
			return instance;
		}
	}
	public String getDomain(){
		return prop.getProperty("domain");
	}
	public String getDhcpOption(){
		return prop.getProperty("dhcp_mode");
	}
}
